package cn.imu.appdevexperiment2020._1activity;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * 描述:
 *
 * @author chenconghua
 * @version 1.0
 * @create 2022-10-29 21:39
 */
public class ActivityCollector {

    public static List<Activity> activities = new ArrayList<>();

    public static void addActivity(Activity activity){
        activities.add(activity);
    }
    public static void removeActivity(Activity activity){
        activities.remove(activity);
    }
    public static void finishAll(){
        for (Activity activity :activities){
            if (!activity.isFinishing()){
                activity.finish();
            }
        }
    }

}
